<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<html>
<head>
    <title>校园风采 - 教育新闻网</title>
    <link href="${pageContext.request.contextPath}/static/css/bootstrap.min.css" rel="stylesheet">
    <style>
        .campus-style-list {
            padding: 30px 0;
        }
        .campus-style-item {
            margin-bottom: 30px;
            transition: all 0.3s;
        }
        .campus-style-item:hover {
            transform: translateY(-5px);
        }
        .campus-style-image {
            width: 100%;
            height: 200px;
            object-fit: cover;
            border-radius: 8px;
            margin-bottom: 15px;
        }
        .campus-style-title {
            font-size: 18px;
            color: #333;
            margin-bottom: 10px;
            display: -webkit-box;
            -webkit-line-clamp: 1;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }
        .campus-style-title a {
            color: #333;
            text-decoration: none;
        }
        .campus-style-title a:hover {
            color: #0d6efd;
        }
        .campus-style-meta {
            color: #666;
            font-size: 14px;
        }
        .campus-style-description {
            color: #666;
            margin-top: 10px;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }
    </style>
</head>
<body>
    <!-- 引入头部 -->
    <jsp:include page="/user/common/header.jsp"/>
    
    <div class="container">
        <nav aria-label="breadcrumb">
            <ol class="breadcrumb">
                <li class="breadcrumb-item"><a href="${pageContext.request.contextPath}/user/home">首页</a></li>
                <li class="breadcrumb-item active">校园风采</li>
            </ol>
        </nav>
        
        <div class="campus-style-list">
            <div class="row">
                <c:forEach items="${styleList}" var="style">
                    <div class="col-md-4 campus-style-item">
                        <img src="${pageContext.request.contextPath}/${style.imageUrl}" 
                             class="campus-style-image" alt="${style.title}">
                        <h3 class="campus-style-title">
                            <a href="${pageContext.request.contextPath}/user/campus-style/detail?id=${style.styleId}">
                                ${style.title}
                            </a>
                        </h3>
                        <div class="campus-style-meta">
                            <fmt:formatDate value="${style.createTime}" pattern="yyyy-MM-dd HH:mm"/>
                        </div>
                        <div class="campus-style-description">
                            ${style.description}
                        </div>
                    </div>
                </c:forEach>
            </div>
            
            <!-- 分页 -->
            <c:if test="${totalPages > 1}">
                <nav class="mt-4">
                    <ul class="pagination justify-content-center">
                        <li class="page-item ${currentPage == 1 ? 'disabled' : ''}">
                            <a class="page-link" href="${pageContext.request.contextPath}/user/campus-style?page=${currentPage - 1}">上一页</a>
                        </li>
                        
                        <c:forEach begin="1" end="${totalPages}" var="i">
                            <li class="page-item ${currentPage == i ? 'active' : ''}">
                                <a class="page-link" href="${pageContext.request.contextPath}/user/campus-style?page=${i}">${i}</a>
                            </li>
                        </c:forEach>
                        
                        <li class="page-item ${currentPage == totalPages ? 'disabled' : ''}">
                            <a class="page-link" href="${pageContext.request.contextPath}/user/campus-style?page=${currentPage + 1}">下一页</a>
                        </li>
                    </ul>
                </nav>
            </c:if>
        </div>
    </div>
    
    <!-- 引入底部 -->
    <jsp:include page="/user/common/footer.jsp"/>
    
    <script src="${pageContext.request.contextPath}/static/js/bootstrap.bundle.min.js"></script>
</body>
</html> 